#include <iostream>
#include <string>
using namespace std;

void SWAP(float *ptr_x, float *ptr_y)
{
	float z;
	z=*ptr_x;
	*ptr_x=*ptr_y;
	*ptr_y=z;


}
void SWAP(float &x, float &y)
{
	float h;
	h=x;
	x=y;
	y=h;
}
void SWAP(string &x, string &y)
{
	string s;
	s=x;
	x=y;
	y=s;
}

int main()
{
	float x,y;
	string a,b;
	setlocale(LC_ALL,"swedish");
	cout<<"skiv in float x:";
	cin>>x;
	cout<<endl<<"skriv in float y:";
	cin>>y;
	cout<<endl<<"skiv in string a:";
	cin>>a;
	cout<<endl<<"skriv in string b:";
	cin>>b;
	SWAP (&x,&y);
	cout<<"nu x,y bytt plats"<<endl<< "x="<<x<<endl;
	cout<<"y="<<y<<endl;

	SWAP (x,y);
	cout<<"nu x,y bytt plats igen"<<endl<< "x="<<x<<endl;
	cout<<"y="<<y<<endl;

	SWAP (a,b);
	cout<<"nu a,b bytt plats"<<endl<< "a="<<a<<endl;
	cout<<"b="<<b<<endl;

	system("PAUSE");

	return 0;
}

